home *** CD-ROM | disk | FTP | other *** search
/ CD Concept 6 / CD Concept 06.iso / mac / UTILITAIRE / Little Smalltalk v3.1.4 / C Source / Headers / env.h < prev    next >
Text File  |  1994-08-31  |  5KB  |  233 lines

  1. /*
  2.     Little Smalltalk, version two
  3.     Written by Tim Budd, Oregon State University, July 1987
  4.  
  5.     environmental factors
  6.  
  7.     This include file gathers together environmental factors that
  8.     are likely to change from one C compiler to another, or from
  9.     one system to another.  Please refer to the installation 
  10.     notes for more information.
  11.  
  12.     for systems using the Make utility, the system name is set
  13.     by the make script.
  14.     other systems (such as the Mac) should put a define statement
  15.     at the beginning of the file, as shown below
  16. */
  17.  
  18. /*
  19. systems that don't use the Make utility should do something like this:
  20. */
  21.  
  22. # define THINKC
  23.  
  24. /*======================= rules for various systems ===========================*/
  25.  
  26. # ifdef B42
  27.     /* Berkeley 4.2, 4.3 and compatible running tty interface */
  28.         /*   which include: */
  29.         /* sequent balance */
  30.         /* Harris HCX-7 */
  31.         /* sun workstations */
  32.  
  33. typedef unsigned char byte;
  34.  
  35. # define byteToInt(b) (b)
  36.  
  37. /* this is a bit sloppy - but it works */
  38. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  39.  
  40. # define STRINGS
  41. # define SIGNAL
  42.  
  43. # endif
  44.  
  45. /*============================================================================*/
  46.  
  47. # ifdef SYSV
  48.     /* system V systems including: */
  49.     /*    HP-UX for the HP-9000 series */
  50.     /*     TEK 4404 with some modifications (see install.ms) */
  51.  
  52. typedef unsigned char byte;
  53.  
  54. # define byteToInt(b) (b)
  55.  
  56. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  57.  
  58. # define STRING
  59.  
  60. # endif
  61.  
  62. /*============================================================================*/
  63.  
  64. # ifdef TURBOC
  65.     /* IBM PC and compatiables using the TURBO C compiler */
  66.     
  67.     /* there are also changes that have to be made to the 
  68.         smalltalk source; see installation notes for
  69.         details */
  70.  
  71. typedef unsigned char byte;
  72.  
  73. # define byteToInt(b) (b)
  74.  
  75. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  76.  
  77. # define STRING
  78. # define ALLOC
  79. # define BINREADWRITE
  80. # define CTRLBRK
  81. # define PROTO
  82. # define obtalloc(x,y) (struct objectStruct huge *) farcalloc((unsigned long) x, (unsigned long) y)
  83.  
  84. #endif
  85.  
  86. /*============================================================================*/
  87.  
  88. # ifdef ATARI
  89.     /* Atari st 1040 - still exprimental */
  90.     
  91. typedef unsigned char byte;
  92.  
  93. # define byteToInt(b) (b)
  94.  
  95. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  96.  
  97. # define STRING
  98. # define ALLOC
  99. # define BINREADWRITE
  100. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  101.  
  102. #endif
  103.  
  104. /*============================================================================*/
  105.  
  106. # ifdef LIGHTC
  107.         /* Macintosh using Lightspeed C compiler */
  108.         /* see install.ms for other changes */
  109.  
  110. typedef unsigned char byte;
  111.  
  112. # define byteToInt(b) (b)
  113.  
  114. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  115.  
  116. # define STRINGS
  117. # define BINREADWRITE
  118. # define STDWIN
  119. # define NOARGC
  120. # define PROTO
  121. # define NOSYSTEM
  122. # define USE_NATIVE_TEXTEDIT        /* Define to use Macintosh native TextEdit routines     */
  123. # define obtalloc(x,y) (struct objectStruct *) calloc((unsigned) x, (unsigned) y)
  124.  
  125. #endif
  126.  
  127. /*============================================================================*/
  128.  
  129. # ifdef THINKC
  130.         /* Macintosh using Think C/Symantec C++ compiler */
  131.         /* see install.ms for other changes */
  132.  
  133. typedef unsigned char byte;
  134.  
  135. # define byteToInt(b) (b)
  136.  
  137. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  138.  
  139. # define BINREADWRITE
  140. # define STDWIN            /* Must be defined even if TCL is defined. */
  141. # define TCL            /* Define TCL to use extended user interface facilities
  142.                              - this must be used in conjunction with Smalltalk 
  143.                                module, tclwin.st and the C module, macio.c. If
  144.                               you do not wish to use the TCL extensions, compile
  145.                               using unixio.c. */
  146. # define NOARGC
  147. # define PROTO
  148. # define NOSYSTEM
  149. # define STRING
  150. # define obtalloc(x,y) (struct objectStruct *) calloc((size_t) x, (size_t) y)
  151. # define class klass    /* (To prevent the use of the reserved word 'class') */
  152.  
  153. # endif
  154.  
  155. /*============================================================================*/
  156.  
  157. # ifdef VMS 
  158.     /* VAX VMS */
  159.  
  160. typedef unsigned char byte;
  161.  
  162. # define byteToInt(b) (b)
  163.  
  164. # define longCanBeInt(l) ((l >= -16383) && (l <= 16383))
  165.  
  166. # define STRING
  167. # define NOARGC
  168.  
  169. # endif
  170.  
  171. /* ============ various defines that should work on all systems ============ */
  172.  
  173. # define streq(a,b) (strcmp(a,b) == 0)
  174.  
  175. # define true 1
  176. # define false 0
  177.  
  178.     /* define the datatype boolean */
  179. # ifdef NOTYPEDEF
  180. # define boolean int
  181. # endif
  182. # ifndef NOTYPEDEF
  183. typedef int boolean;
  184. # endif
  185.  
  186.     /* define a bit of lint silencing */
  187.     /*  ignore means ``i know this function returns something,
  188.         but I really, really do mean to ignore it */
  189. # ifdef NOVOID
  190. # define ignore
  191. # define noreturn
  192. # define void int
  193. # endif
  194. # ifndef NOVOID
  195. # define ignore (void)
  196. # define noreturn void
  197. # endif
  198.  
  199. /* prototypes are another problem.  If they are available, they should be
  200. used; but if they are not available their use will cause compiler errors.
  201. To get around this we define a lot of symbols which become nothing if
  202. prototypes aren't available */
  203. # ifdef PROTO
  204.  
  205. # define X ,
  206. # define OBJ object
  207. # define OBJP object *
  208. # define INT int
  209. # define BOOL boolean
  210. # define STR char *
  211. # define FLOAT double
  212. # define NOARGS void
  213. # define FILEP FILE *
  214. # define FUNC ()
  215.  
  216. # endif
  217.  
  218. # ifndef PROTO
  219.  
  220. # define X
  221. # define OBJ
  222. # define OBJP
  223. # define INT
  224. # define BOOL
  225. # define STR
  226. # define FLOAT
  227. # define NOARGS
  228. # define FILEP
  229. # define FUNC
  230.  
  231. # endif
  232.  
  233.